package com.bjtang.book.util;

import java.util.Random;

public class 验证码生成器 {

	public static String getText() {
		char[] codeSequence = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'M', 'N', 'P', 'Q', 'R', 'S', 'T',
				'U', 'V', 'W', 'X', 'Y', 'Z', '2', '3', '4', '5', '6', '7', '8', '9' };
		int charNum = codeSequence.length;
		String strRand2 = "";
		Random r = new Random();

		for (int i = 0; i < 4; i++) {
			// 获取随机数
			int number = r.nextInt(charNum);
			strRand2 = strRand2 + codeSequence[number];
		}
		return strRand2;
	}
}
